#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QCheckBox>
#include <QListWidgetItem>
#include <QMessageBox>
#include <QInputDialog>
#include <QUrl>
#include <QDesktopServices>
#include <QTimer>
#include "testmanager.h"
#include "dlgaddtest.h"
#include "test.h"
#include "testnode.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
private slots:
    void on_actionAddTest_triggered();

    void on_lvTests_clicked(const QModelIndex &index);

    void on_btnNext_clicked();

    void on_actionExit_triggered();

    void on_actionAbout_triggered();

    void on_actionOther_triggered();

    void on_actionRepit_triggered();

    void on_actionDelTest_triggered();

    void on_actionHelp_triggered();

    void timered();

private:
    Ui::MainWindow *ui;
    TestManager testManager;
    QList<QCheckBox*> answers;
    Test currentTest;
    TestNode currentNode;
    quint32 realAnswers;
    float per2, per3, per4;
    QTime *tTime;
    QTimer *timer;
    QLabel *numTasksL;
    QLabel *numTasks;
    QLabel *timerView;

    void viewTestsList();
    void showTestNode();
    void clearNodeView();
    void showResult();
    void checkResult();
};

#endif // MAINWINDOW_H
